/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package socketHandler;

import java.io.IOException;
import java.net.Socket;

/**
 *
 * @author lex
 */
public class FielSocketHandler {
    private Socket socket;

    public FielSocketHandler(Socket socket) {
	this.socket = socket;
    }
    public void close()
    {
	try {
            if (socket!=null)
            {
                socket.close();
                socket=null;
            }
        } catch (IOException ex) {}
    }
    public int read(byte[] b) throws IOException
    {
	return socket.getInputStream().read(b);
    }
    public void write(byte[] data) throws IOException
    {
	socket.getOutputStream().write(data);
    }
}
